package org.lib.jpamysql.query.spel;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.Repository;

@NoRepositoryBean // 必须
// Repository 没有任何方法，空接口而已
//public interface MappedTypeRepository<T extends AbstractMappedType> extends Repository<T, Long> {
public interface MappedTypeRepository<T extends AbstractMappedType> extends CrudRepository<T, Long> {

	@Query(value="SELECT t FROM #{#entityName} t WHERE t.attribute = ?1")
	List<T> findAllByAttribute(String attribute);
	
}
